﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="SprintMaintenance.aspx.cs" Inherits="PMP.Maintenance.SprintMaintenance" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Sprint Maintenance</title>
    <style type="text/css">
        .style1
        {
            width: 55%;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    
        <table class="style1">
            <tr>
                <td style="text-align: right">
                    Sprint:</td>
                <td>
                    <asp:TextBox ID="txtSprint" runat="server" Height="25px" Width="200px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td style="text-align: right">
                    NF1 Capacity:</td>
                <td>
                    <asp:TextBox ID="txtNF1Capacity" runat="server" Height="25px" Width="200px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td style="text-align: right">
                    NF1 Capacity Notes:</td>
                <td>
                    <asp:TextBox ID="txtNF1CapacityNotes" runat="server" Height="25px" 
                        Width="200px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td style="text-align: right">
                    NF2 Capacity:</td>
                <td>
                    <asp:TextBox ID="txtNF2Capacity" runat="server" Height="25px" Width="200px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td style="text-align: right">
                    NF2 Capacity Notes:</td>
                <td>
                    <asp:TextBox ID="txtNF2CapacityNotes" runat="server" Height="25px" 
                        Width="200px"></asp:TextBox>
                </td>
            </tr>
            <tr>
                <td style="text-align: right">
                    Sprint Start:</td>
                <td>
                    <asp:TextBox ID="txtSprintStart" runat="server" Height="25px" Width="200px"></asp:TextBox>
&nbsp;(yyyy-MM-dd)</td>
            </tr>
            <tr>
                <td style="text-align: right">
                    <asp:Button ID="btnAdd" runat="server" onclick="btnAdd_Click" Text="Add" />
                </td>
                <td>
                    <asp:Button ID="btnClear" runat="server" onclick="btnClear_Click" 
                        Text="Clear" />
                </td>
            </tr>
        </table>
        <br />
    
        <asp:GridView ID="grvSprints" runat="server" AutoGenerateColumns="False" 
            CellPadding="4" DataKeyNames="id" DataSourceID="SqlDataSourceSprint"
            ForeColor="#333333" GridLines="Both">
            <RowStyle BackColor="#EFF3FB" />
            <Columns>
                <asp:CommandField ShowDeleteButton="True" ShowEditButton="True" />
                <asp:BoundField DataField="sprint" HeaderText="sprint" 
                    SortExpression="sprint" ReadOnly="True" />
                <asp:BoundField DataField="iscompleted" HeaderText="iscompleted" 
                    SortExpression="iscompleted" />
                <asp:BoundField DataField="NF1capacity" HeaderText="NF1capacity" 
                    SortExpression="NF1capacity" />
                <asp:BoundField DataField="NF2capacity" HeaderText="NF2capacity" 
                    SortExpression="NF2capacity" />
                <asp:BoundField DataField="NF1capacity_note" HeaderText="NF1capacity_note" 
                    SortExpression="NF1capacity_note" />
                <asp:BoundField DataField="NF2capacity_note" HeaderText="NF2capacity_note" 
                    SortExpression="NF2capacity_note" />
                <asp:BoundField DataField="sprintstart" HeaderText="sprintstart" 
                    SortExpression="sprintstart" />
                <asp:BoundField DataField="id" HeaderText="id" InsertVisible="False" 
                    ReadOnly="True" SortExpression="id" />
            </Columns>
            <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
            <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
            <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
            <EditRowStyle BackColor="#2461BF" />
            <AlternatingRowStyle BackColor="White" />
        </asp:GridView>
        <asp:SqlDataSource ID="SqlDataSourceSprint" runat="server" 
            ConnectionString="<%$ ConnectionStrings:LocalConnectionString %>" 
            ProviderName="<%$ ConnectionStrings:LocalConnectionString.ProviderName %>" 
            
            
            SelectCommand="SELECT [sprint], [iscompleted], [NF1capacity], [NF2capacity], [NF1capacity_note], [NF2capacity_note], [sprintstart], [id] FROM [sprint] ORDER BY [iscompleted], [sprint]" 
            DeleteCommand="DELETE FROM [sprint] WHERE [id] = ?" 
            InsertCommand="INSERT INTO [sprint] ([sprint], [iscompleted], [NF1capacity], [NF2capacity], [NF1capacity_note], [NF2capacity_note], [sprintstart], [id]) VALUES (?, ?, ?, ?, ?, ?, ?, ?)" 
            UpdateCommand="UPDATE [sprint] SET [iscompleted] = ?, [NF1capacity] = ?, [NF2capacity] = ?, [NF1capacity_note] = ?, [NF2capacity_note] = ?, [sprintstart] = ? WHERE [id] = ?">
            <DeleteParameters>
                <asp:Parameter Name="id" Type="Int32" />
            </DeleteParameters>
            <UpdateParameters>
                <asp:Parameter Name="iscompleted" Type="Int32" />
                <asp:Parameter Name="NF1capacity" Type="Decimal" />
                <asp:Parameter Name="NF2capacity" Type="Decimal" />
                <asp:Parameter Name="NF1capacity_note" Type="String" />
                <asp:Parameter Name="NF2capacity_note" Type="String" />
                <asp:Parameter Name="sprintstart" Type="String" />
                <asp:Parameter Name="id" Type="Int32" />
            </UpdateParameters>
            <InsertParameters>
                <asp:Parameter Name="sprint" Type="String" />
                <asp:Parameter Name="iscompleted" Type="Int32" />
                <asp:Parameter Name="NF1capacity" Type="Decimal" />
                <asp:Parameter Name="NF2capacity" Type="Decimal" />
                <asp:Parameter Name="NF1capacity_note" Type="String" />
                <asp:Parameter Name="NF2capacity_note" Type="String" />
                <asp:Parameter Name="sprintstart" Type="String" />
                <asp:Parameter Name="id" Type="Int32" />
            </InsertParameters>
        </asp:SqlDataSource>
    
    </div>
    </form>
</body>
</html>
